package com.cljh.service.impl;

import com.cljh.bean.Comment;
import com.cljh.mapper.CommentMapper;
import com.cljh.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;

    @Override
    public List<Comment> selectByArticleId(Integer id) {
        return commentMapper.selectByArticleId(id);
    }

    @Override
    public boolean deleteById(Integer id) {
        return commentMapper.deleteById(id)>0;
    }

    @Override
    public boolean save(Comment comment) {
        return commentMapper.save(comment)>0;
    }

    @Override
    public boolean update(Comment comment) {
        return commentMapper.update(comment)>0;
    }

    @Override
    public Comment selectById(Integer id) {
        return commentMapper.selectById(id);
    }
}
